#include <bits/stdc++.h>
using namespace std;

using llt = long long;
using vi = vector<int>;
using Real = long double;

struct Point {
    llt x, y;
    Real dist(const Point & p) const {
        auto u = x - p.x, v = y - p.y;
        return sqrt(u * u + v * v);
    } 
};

void work(){
    array<Point, 4> a;
    for(auto & p : a) cin >> p.x >> p.y;
    Real ans = 0;
    for(int i=0;i<4;++i){
        ans += a[i].dist(a[(i+1)%4]);
    }
    cout << fixed << setprecision(12) << ans << endl;
    return;
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int nofkase = 1;
    // cin >> nofkase;
    while(nofkase--) work();
    return 0;
}
